#ifndef SYSTEM_LOG_HH
#define SYSTEM_LOG_HH
using namespace System;
using namespace System::Diagnostics;
#include <string>

static inline
void dbg_print(char *str)
{
    static int src_created = 0;
    String *sSource;

    sSource = new String("MartyMotorService");

    if (0 == src_created) {
        String *sLog;
        sLog = new String("Application");

        if(!EventLog::SourceExists(sSource)) 
            EventLog::CreateEventSource(sSource,sLog);
        src_created++;
    }
    
    EventLog::WriteEntry(sSource, new String(str));
}

#endif